﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace cimdict
{
    public partial class CIMDictMainForm : Form
    {
        public CIMDictMainForm()
        {
            InitializeComponent();

            CIMInterface.GUI.progressBar = toolStripProgressBar1;
            CIMInterface.GUI.statusLabel = toolStripStatusLabel1;
            CIMInterface.GUI.classTreeView = classTreeView;
            //CIMInterface.GUI.propTreeView = propTreeView;
            CIMInterface.GUI.inheritTreeView = inheriTreeView;
            CIMInterface.GUI.fullPropTreeView = fullPropTreeView;
            CIMInterface.GUI.mainForm = this;

            CIMInterface.GUI.className = nameBox;
            CIMInterface.GUI.classBaseName = baseBox;
            CIMInterface.GUI.classVersion = versionBox;
            CIMInterface.GUI.classFilePath = pathBox;
            CIMInterface.GUI.classDescription = classDescBox;

            CIMInterface.GUI.propName = pnameBox;
            CIMInterface.GUI.propParam = pparamBox;
            CIMInterface.GUI.propDefination = pdefBox;
            CIMInterface.GUI.propDescription = propDescBox;

        }

        private void DictUI_Load(object sender, EventArgs e)
        {
            
            
        }

        private void progressBar1_Click(object sender, EventArgs e)
        {

        }



        private void button1_Click(object sender, EventArgs e)
        {
            
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (classTreeView.SelectedNode != null)
            {
                CIMInterface.selectClass(classTreeView.SelectedNode.Name);
            }
        }

        private void loadMOFToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CIMInterface.initUI();
        }
/*
        private void propertyTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            
            if (propTreeView.SelectedNode != null)
            {
                CIMInterface.selectProp(propTreeView.SelectedNode.Name);
            }
        }

        private void hierachyViewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CIMInterface.hierarchyView();
        }

        private void planViewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CIMInterface.plainView();
        }
*/
        private void viewBaseClass_Click(object sender, EventArgs e)
        {
            CIMInterface.selectClass(baseBox.Text.ToLower());
        }

        private void searchFilterViewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SearchFilterForm sf = new SearchFilterForm();
            sf.Show();
        }

        private void inheriTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (inheriTreeView.SelectedNode != null)
            {
                CIMInterface.selectClass(inheriTreeView.SelectedNode.Name);
            }
        }

        private void fullPropTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (fullPropTreeView.SelectedNode != null)
            {
                CIMInterface.selectFullProp();
            }
        }
 

        private void bySortToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CIMInterface.plainView();
        }

        private void byHierachyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CIMInterface.hierarchyView();
        }

        private void toExcelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ExportExcelForm eef = new ExportExcelForm();
            eef.Show();
        }
    }
}
